// function queryobj() {
//     let search = location.search.substr(1);
//     const res = {}
//     search.split('&').forEach((pas) => {
//         let txt = pas.split('=');
//         let key = txt[0];
//         let val = txt[1];
//         res[key] = val
//     })
//     return res
// }

function queryobj() {
    let search = location.search;
    console.log(search);

    let res = {};
    let med = new URLSearchParams(search);
    console.log(med);

    med.forEach((item, index) => {
        res[index] = item;
    })
    return res
}

console.log(queryobj());